<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This file documents the use of the GNU compilers.

Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Variable Attributes (Using the GNU Compiler Collection (GCC))</title>

<meta name="description" content="Variable Attributes (Using the GNU Compiler Collection (GCC))">
<meta name="keywords" content="Variable Attributes (Using the GNU Compiler Collection (GCC))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Indices.html" rel="index" title="Indices">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="C-Extensions.html" rel="up" title="C Extensions">
<link href="Type-Attributes.html" rel="next" title="Type Attributes">
<link href="Function-Attributes.html" rel="prev" title="Function Attributes">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
kbd.key {font-style: normal}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en_US">
<div class="section-level-extent" id="Variable-Attributes">
<div class="nav-panel">
<p>
Next: <a href="Type-Attributes.html" accesskey="n" rel="next">Specifying Attributes of Types</a>, Previous: <a href="Function-Attributes.html" accesskey="p" rel="prev">Declaring Attributes of Functions</a>, Up: <a href="C-Extensions.html" accesskey="u" rel="up">Extensions to the C Language Family</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="Specifying-Attributes-of-Variables"><span>6.34 Specifying Attributes of Variables<a class="copiable-link" href="#Specifying-Attributes-of-Variables"> &para;</a></span></h3>
<a class="index-entry-id" id="index-attribute-of-variables"></a>
<a class="index-entry-id" id="index-variable-attributes"></a>

<p>The keyword <code class="code">__attribute__</code> allows you to specify special properties
of variables, function parameters, or structure, union, and, in C++, class
members.  This <code class="code">__attribute__</code> keyword is followed by an attribute
specification enclosed in double parentheses.  Some attributes are currently
defined generically for variables.  Other attributes are defined for
variables on particular target systems.  Other attributes are available
for functions (see <a class="pxref" href="Function-Attributes.html">Declaring Attributes of Functions</a>), labels (see <a class="pxref" href="Label-Attributes.html">Label Attributes</a>),
enumerators (see <a class="pxref" href="Enumerator-Attributes.html">Enumerator Attributes</a>), statements
(see <a class="pxref" href="Statement-Attributes.html">Statement Attributes</a>), and for types (see <a class="pxref" href="Type-Attributes.html">Specifying Attributes of Types</a>).
Other front ends might define more attributes
(see <a class="pxref" href="C_002b_002b-Extensions.html">Extensions to the C++ Language</a>).
</p>
<p>See <a class="xref" href="Attribute-Syntax.html">Attribute Syntax</a>, for details of the exact syntax for using
attributes.
</p>

<ul class="mini-toc">
<li><a href="Common-Variable-Attributes.html" accesskey="1">Common Variable Attributes</a></li>
<li><a href="ARC-Variable-Attributes.html" accesskey="2">ARC Variable Attributes</a></li>
<li><a href="AVR-Variable-Attributes.html" accesskey="3">AVR Variable Attributes</a></li>
<li><a href="Blackfin-Variable-Attributes.html" accesskey="4">Blackfin Variable Attributes</a></li>
<li><a href="H8_002f300-Variable-Attributes.html" accesskey="5">H8/300 Variable Attributes</a></li>
<li><a href="IA_002d64-Variable-Attributes.html" accesskey="6">IA-64 Variable Attributes</a></li>
<li><a href="LoongArch-Variable-Attributes.html" accesskey="7">LoongArch Variable Attributes</a></li>
<li><a href="M32R_002fD-Variable-Attributes.html" accesskey="8">M32R/D Variable Attributes</a></li>
<li><a href="Microsoft-Windows-Variable-Attributes.html" accesskey="9">Microsoft Windows Variable Attributes</a></li>
<li><a href="MSP430-Variable-Attributes.html">MSP430 Variable Attributes</a></li>
<li><a href="Nvidia-PTX-Variable-Attributes.html">Nvidia PTX Variable Attributes</a></li>
<li><a href="PowerPC-Variable-Attributes.html">PowerPC Variable Attributes</a></li>
<li><a href="RL78-Variable-Attributes.html">RL78 Variable Attributes</a></li>
<li><a href="V850-Variable-Attributes.html">V850 Variable Attributes</a></li>
<li><a href="x86-Variable-Attributes.html">x86 Variable Attributes</a></li>
<li><a href="Xstormy16-Variable-Attributes.html">Xstormy16 Variable Attributes</a></li>
</ul>
</div>



</body>
</html>
